import { defineComponent, ref, reactive } from 'vue'
import type { todoItem } from '@/type/todo'
type Props = {
    todoList: todoItem[]
}
import { useUserStore } from '@/stores/user'
export default defineComponent({
    props:['todoList'],
    setup(props: Props) {
        const userStore = useUserStore()
        console.log(props.todoList.length);
        const changeName = () => {
            userStore.changeName()
        }
        return () => (
             props.todoList.length === 0 ?
                (<el-empty/>)
                : 
                (
                    <div>
                        <div>名字{userStore.nickName}</div>
                        <button onClick={changeName}>修改</button>
                    </div>
                    // props.todoList.map(item => (
                    //     <el-checkbox label={item.title} checked={item.done}></el-checkbox>
                    // ))
                )
                
        )
    }
})